package com.csproj.dispatch.util;

/**
 * @作者：Administrator
 * @时间：20:52 2018/9/11 0011
 * @用途：报警类型
 **/
public enum WarnType {
    DISMANTLING("warn_disassemble_bonnet", 1), LOCBARCUT("warn_lever_shearing", 2), UNDERVOLTAGE("warn_lvd", 3), SPEEDING("warn_overspeed", 4), NOGPS("warn_gps_lost", 5)
    , TIMEOUT("warn_long_time", 6),MIGRATION("warn_route_deviation", 7),LONGPARKING("warn_park_long_time", 8);
    // 成员变量
    private String name;
    private int index;
    // 构造方法
    private WarnType(String name, int index) {
        this.name = name;
        this.index = index;
    }
    // 普通方法
    public static String getName(int index) {
        for (WarnType c : WarnType.values()) {
            if (c.getIndex() == index) {
                return c.name;
            }
        }
        return null;
    }
    // get set 方法
    public String getName() {
        return name;
    }
    public void setName(String name) {
        this.name = name;
    }
    public int getIndex() {
        return index;
    }
    public void setIndex(int index) {
        this.index = index;
    }
}
